package service;

import domain.ImageEntry;
import org.apache.wicket.util.resource.ResourceStreamNotFoundException;
import org.springframework.transaction.annotation.Transactional;
import web.admin.config.DirectoryPathException;

import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
import java.util.List;

public interface ImageService {

    public byte[] getImage(ImageEntry imageEntry)
            throws IOException, ResourceStreamNotFoundException;

    public boolean isImageAvailable(ImageEntry imageEntry);

    public Date getLastModifyTime(ImageEntry imageEntry);

    public byte[] getThumbnail(ImageEntry imageEntry)
            throws IOException, ResourceStreamNotFoundException;

    @Transactional
    public ImageEntry save(ImageEntry imageEntry, InputStream imageStream)
            throws Exception, DirectoryPathException;

    @Transactional
    public ImageEntry findLastImage();

    @Transactional
    public List<ImageEntry> findAllImages();
}
